<template>
    <div class="toast">
        <i :class="type=='success'?'iconfont icon-toast_chenggong':(type=='warning'?'iconfont icon-toast-jinggao':'iconfont icon-toast-shibai_huaban ') "></i>
        <span>{{ msg }}</span>
    </div>
</template>

<script>
import { mapState } from "vuex";
export default {
    name: 'WorkspaceJsonToast',

    data() {
        return {
            
        };
    },
computed:{
    ...mapState({
        msg:a=>a.showtoast.msg,
        type:a=>a.showtoast.type,
    })
},
    mounted() {
    },
    methods: {
    },
};
</script>

<style lang="scss" scoped>
.toast{
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    box-shadow:0 0 10px #fff;
    i{
        margin-right: 8px;
    }
    .icon-toast_chenggong{
        color: green;
    }
    .icon-toast_jinggao{
        color: orange;
    }
    .icon-toast_shibai_huaban{
        color: red;
    }

}
</style>